#pragma once
#include "operatorResponse.h"
#include <ctime>

class TokenInfo
{
public:
	TokenInfo();
	~TokenInfo();
	void jsonDeserialize(JsonValue const& doc);
	std::string getToken() const;
	bool nearestExpire() const;
private:
	int64_t deviceId = 0;
	int64_t orgUnitId = 0;
	String code;
	String accessToken;
	int expiresIn = 0;
	clock_t endClock = 0;
};

class TokenRes : public OperatorResponse
{
public:
	virtual JsonDoc& jsonDeserialize(const String& json);
	TokenInfo getToken() const;
private:
	TokenInfo token;
};

